package com.spzx.user.api.service;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.user.api.domain.UserAddress;
import com.spzx.user.api.factory.RemoteUserAddressFallbackFactory;
import com.spzx.user.api.factory.RemoteUserInfoFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteUserAddressService",value = ServiceNameConstants.USER_SERVICE,fallbackFactory = RemoteUserAddressFallbackFactory.class)
public interface RemoteUserAddressService {


    @Operation(summary = "供微服务内部远程调用根据用户id获取用户收货地址")
    @GetMapping("/userAddress/getUserAddressById/{id}")
    public R<UserAddress> getUserAddressByUserId(@PathVariable("id") Long id,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
